using System;
using System.Collections.Generic;
using System.Text;
using phorm.database.core;

namespace phorm.model.fields
{
    /// <summary>
    /// A SQL decimal column with a specified set of digits and decimal places.
    /// </summary>
    public class SQLDecimal : DatabaseColumn
    {
        /// <summary>
        /// Constructor for initializing column specifics and populating column into model object.
        /// </summary>
        /// <param name="obj">The model object to which this column belongs</param>
        /// <param name="digits">Digit precision for this column</param>
        /// <param name="decimalPlaces">Decimal place precision for this column</param>
        public SQLDecimal(DatabaseRecord obj, int digits, int decimalPlaces)
        {
            this._model = obj;
            this.length = digits.ToString()+","+decimalPlaces.ToString();
            this.field_type = "decimal";
            populateColumn();
        }
    }
}
